module utils.common;

/** 
 * 明文密码加密为sha256字符串
 * Params:
 *   plainPwd = 明文密码 = string
 * Returns: SHA256 = string
 */
string toSHA256String(string plainPwd)
{
    import std.digest.sha : toHexString, sha256Of, Order, LetterCase;
    import utils.constant : Constant;

    // 明文密码sha256加密
    string pwd = toHexString!(Order.increasing, LetterCase.lower)(
        sha256Of(Constant.PWD_SALT ~ plainPwd));

    return pwd;
}
